package com.game.server.message.proto.execute;

import com.comm.ISession;

import com.game.majiang.logic.LogicClient;
import com.game.majiang.logic.LogicServer;
import com.game.server.db.dao.XyNotificationLogDao;
import com.game.server.message.proto.in.AbstractXYleaveClubReq;
import com.game.server.message.proto.out.XYInformDataAlterRsp;

public class XYleaveClubReq extends AbstractXYleaveClubReq {

    @Override
    public void Execute(ISession session) {
        LogicClient client = (LogicClient) LogicServer.getInstance().getClient(session.getId());
        if (client != null&&client.checkClick(msgcode)) {
            client.setClubid(0);

            //俱乐部红点
            int notifCount = XyNotificationLogDao.findMyNotifCount(client.getUserId());
            if (notifCount>0){
                XYInformDataAlterRsp alterRsp = new XYInformDataAlterRsp();
                alterRsp.setType(6);
                alterRsp.setOperateclubid(client.getUserId());
                alterRsp.setClubid(0);
                alterRsp.setUnionid(0);
                client.Send(alterRsp);
            }
        }
    }

}
